<%--
  Created by IntelliJ IDEA.
  User: 29276
  Date: 2021/8/22
  Time: 20:36
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    //http://localhost:8080/01_sxtoa_war_exploded/
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/select.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="js/select-ui.min.js"></script>
    <script type="text/javascript" src="editor/kindeditor.js"></script>
    <script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(document).ready(function(e) {
            $(".select1").uedSelect({
                width : 345
            });

        });
    </script>

    <script type="text/javascript">
        $(function () {
            $.post("deptServlet", {methodName:"deptList"}, function (data) {
                if (data === "sessionTimeOut") {
                    window.location.href="login.jsp";
                    return;
                }
                eval("var ds="+data);
                var deptSelect = $("#deptSelect");
                for (var i = 0; i < ds.length; i++) {
                    deptSelect.append("<option value='"+ds[i].deptNo+"'>"+ds[i].deptName+"</option>");
                }
            })
        })
    </script>

    <script type="text/javascript">
        $(function () {
            $("#submit").click(function () {
                var reqData = $("#incomeFm").serialize();
                console.log(reqData);
                $.post("incomeServlet", reqData, function (data) {
                    if (data === "sessionTimeOut") {
                        window.location.href="login.jsp";
                        return;
                    }
                    if (eval(data)) {
                        alert("添加成功！");
                    } else {
                        alert("添加失败！");
                    }
                })
            })

        })
    </script>
</head>

<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">收支管理</a></li>
        <li><a href="#">添加收入</a></li>
    </ul>
</div>

<div class="formbody">

    <div class="formtitle"><span>基本信息</span></div>
    <form id="incomeFm" action="">
        <ul class="forminfo">
            <input name="methodName" type="hidden" value="incomeAdd"/>

            <li>
                <label>所属部门<b>*</b></label>
                <div class="vocation">
                    <select id="deptSelect" name="deptNo" class="select1">
                        <option value="">请选择</option>
                    </select>
                </div>

            </li>
            <li>
                <label>收入金额</label>
                <input name="amount" type="text" class="dfinput" /><i></i></li>
            <li>
                <label>收入类型</label>
                <cite>
                    <input name="incomeType" type="radio" value="人员外包" checked="checked" />人员外包&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="incomeType" type="radio" value="项目开发" />项目开发&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="incomeType" type="radio" value="报名费" />报名费&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="incomeType" type="radio" value="学费" />学费&nbsp;&nbsp;&nbsp;&nbsp;
                </cite>
            </li>
            <li>
                <label>收入日期</label>
                <input name="incomeDate" type="text" class="dfinput" onfocus="WdatePicker()" />
            </li>
            <li>
                <label>备注</label>
                <textarea name="incomeDesc" cols="" rows="" class="textinput"></textarea>
            </li>
            <li>
                <label>&nbsp;</label>
                <input id="submit" name="" type="button" class="btn" value="确认保存" />
            </li>
        </ul>
    </form>
</div>

</body>

</html>
